//
//  LXBuyCarListController.m
//  灵秀
//
//  Created by 李田 on 17/3/19.
//  Copyright © 2017年 tianyao. All rights reserved.
//

#import "LXBuyCarListController.h"
#import "LXAnimator.h"
#import "LXDetailsListCell.h"
static NSString *cellID = @"cell_ID";
@interface LXBuyCarListController ()<UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *listTableView;

@end

@implementation LXBuyCarListController{
    
    LXAnimator *_animator;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    
    if (self) {
        //         告诉系统转场的模式- custom
        self.modalPresentationStyle = UIModalPresentationCustom;
        
        //2. 遵守转场的代理协议
        //创建动画器
        _animator = [[LXAnimator alloc]init];
        
        self.transitioningDelegate = _animator;
    }
    
    return self;
}

#pragma mark - 2.0 数据源方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return self.dataListArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    LXDetailsListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell_ID" forIndexPath:indexPath];
    
    cell.model = self.dataListArray[indexPath.row];
    return cell;
}

#pragma mark - 1.0 界面搭建
- (void)setupUI {
    
    // 设置行高
    _listTableView.rowHeight = 60;
    // 取消下划线
    _listTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    // 设置代理
    _listTableView.delegate = self;
    // 设置数据源
    _listTableView.dataSource = self;
    // 注册
    [self.listTableView registerClass:[LXDetailsListCell class] forCellReuseIdentifier:@"cell_ID"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
